/**
 * 处理后的地址
 * @param url 原始url
 * @returns
 */
export function mergeBaseURL(url?: string) {
  if (!url) return ''
  if (/^(http|https)/.test(url)) return url
  let baseURL = import.meta.env.VITE_BASE_URL
  baseURL = ['/'].some(v => baseURL.startsWith(v))
    ? window.location.origin
    : baseURL
  const u = new URL(url, baseURL)
  return u.href
}

/**默认logo地址 */
export { default as LogoDefaultURL } from '@/assets/logo.svg'
